/**
 * Created by linweihao on 15/10/12.
 */

function test(node) {
    var s = $(node).val()
    $.get("http://127.0.0.1:8080/search?title=连衣裙&t=json", function (data) {
        return data
    })
}

function setSelected(node) {
    var div = $(node)
    if (div.attr("selected")) {
        div.removeClass("selected").removeClass("bg-danger").attr("selected", false)
    } else {
        div.addClass("selected").addClass("bg-danger").attr("selected", true)
    }

}

function deleCollocation() {
    var options = {collocationIds: []}
        , url = "http://127.0.0.1:8080/editCollocation"
        , selectedCollocations = $('.selected')
    selectedCollocations.each(function () {
        options.collocationIds.push($(this).attr('id'))
    })
    $.post(url, {params: JSON.stringify(options)}, function (data) {
        setTimeout('window.location.reload()', 30)
        return data
    })

}